package com.lagou.edu.controller;

import com.lagou.edu.service.LagouEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/email")
public class LagouEmailController {
    @Autowired
    private LagouEmailService lagouEmailService;


    @GetMapping("/{email}/{code}")
    public Boolean sendMail(@PathVariable("email") String email,
                            @PathVariable("code") String code) {
        return lagouEmailService.sendEmail(email, code);
    }



}
